Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
Cypress test with session, fails with "401: Unauthorized"

Cypress test with session, fails with "401: Unauthorized" on line
cy.visit('/admin/people/create');

Why am I getting this error?

file cypress.json

"experimentalSessionSupport": true,

file with test code:

describe('Session testing', () => {
  const login = (name,password) =>{
    cy.session([name,password],()=>{
      cy.visit('/', {
        auth: {
          username: 'username',
          password: 'password',
        },
      });
  
      // Filling field email to 'Log in' form
      cy.get('#edit-name--2').type(name);
      // Filling field pass to 'Log in' form
      cy.get('#edit-pass--2').type(password);
      cy.get('#edit-submit--2').click();

    })
  }

  beforeEach(()=>{
    login('username','password');
  })
  
  // Creating user with 'Organisation responsible' role
  it('Create organisation responsible user', () => {

    cy.visit('/admin/people/create');

  });

});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!